package com.ling.map
{
	import com.ling.brushes.view.JellyBrush;
	import com.tommy.ddp.definition.GridSkinFactory;
	
	import flash.display.Bitmap;
	import flash.display.BitmapData;

	public class BgGridStyle
	{
		/*public static const NORMAL:uint = 0;
		public static const JELLY:uint = 1;
		public static const DOUBLE_JELLY:uint = 2;
		public static const STONE:uint = 3;
		public static const WIRE:uint = 4;*/
		//
		private static var normalBmp:Class;
		[Embed(source="../img/glassGridSkin.png")]
		private static var jellyBmp:Class;
		[Embed(source="../img/doubleGlassGridSkin.png")]
		private static var doubleJellyBmp:Class;
		[Embed(source="../img/barrierGridSkin.png")]
		private static var stoneBmp:Class;
		[Embed(source="../img/wireNetGridSkin.png")]
		private static var wireBmp:Class;
		[Embed(source="../img/emptyGridSkin.png")]
		private static var emptyBmp:Class;
		
		
		private static var normapBmd:BitmapData;
		private static var jellyBmd:BitmapData;
		private static var doubleJellyBmd:BitmapData;
		private static var stoneBmd:BitmapData;
		private static var wireBmd:BitmapData;
		private static var emptyBmd:BitmapData;
		
		public function BgGridStyle()
		{
		}
		
		setup();
		
		private static function setup():void
		{
			normapBmd = new BitmapData(1,1,true,0);
			jellyBmd = (new jellyBmp as Bitmap).bitmapData;
			doubleJellyBmd = (new doubleJellyBmp as Bitmap).bitmapData;
			stoneBmd = (new stoneBmp as Bitmap).bitmapData;
			wireBmd = (new wireBmp as Bitmap).bitmapData;
			emptyBmd = (new emptyBmp as Bitmap).bitmapData;
		}
		
		public static function getBmd(v:uint):BitmapData
		{
			if(v == GridSkinFactory.NORMAL)
				return normapBmd;
			else if(v == GridSkinFactory.GLASS)
				return jellyBmd;
			else if(v == GridSkinFactory.DOUBLE_GLASS)
				return doubleJellyBmd;
			else if(v == GridSkinFactory.BARRIRE)
				return stoneBmd;
			else if(v == GridSkinFactory.WIRE_NET)
				return wireBmd;
			else if(v == GridSkinFactory.EMPTY)
				return emptyBmd;
			else
				return normapBmd;
		}
	}
}